package com.pattern.TWO;

import com.claims.UserClaimsApply;

/**
 * Created by 峥桂 on 2017/6/9.
 */
public class ClaimsLinkHelper {

    private BaseAbstractLink baseAbstractLink;
    public BaseAbstractLink getLinkObj(ClaimsEnum status, UserClaimsApply userClaimsApply){

        //准备对象
        switch (status){
            case Link_First_Audit:
                baseAbstractLink= new FirstAuditLink();
                break;
            case Link_Input_Data:
                baseAbstractLink= new InputDataLink();
                break;
            default:
                baseAbstractLink=null;
        }
        if(baseAbstractLink!=null){
            baseAbstractLink.setUserClaimsApply(userClaimsApply);
            baseAbstractLink.setCurrentLinkValue(status.getValue());
            System.out.println( "进入"+status.getValue()+"---->理赔单信息如下:");
            System.out.println("理赔申请 code:"+baseAbstractLink.userClaimsApply.getApplycode()+" ID:"+baseAbstractLink.userClaimsApply.getId());
        }

        //开始执行相应的方法
        baseAbstractLink.claimTask();
        baseAbstractLink.handlerTask();


        return baseAbstractLink;
    }



}
